let myChart1 = echarts.init(document.getElementById('main1'))

// 指定图表的配置项和数据
let option1 = {
    title: {
        text: '2019年注册人数',
        textStyle: {
            color: '#fff'
        }
    },
    tooltip: {},
    legend: {
        data: ['人数']
    },
    xAxis: {
        data: ["一月", "二月", "三月", "四月", "五月", "六月"]
    },
    yAxis: {},
    series: [{
        name: '人数',
        type: 'bar',
        data: [150, 50, 136, 70, 140, 190]
    }]
}

// 使用刚指定的配置项和数据显示图表。
myChart1.setOption(option1)


// ------------------------------------------------

let myChart2 = echarts.init(document.getElementById('main2'))

let option2 = {
    title : {
        text: '12月份售出数量',
        // subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['阿迪','耐克','老北京布鞋','李宁宁','匡威']
    },
    series : [
        {
            name: '数量',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
                {value:335, name:'阿迪'},
                {value:310, name:'耐克'},
                {value:234, name:'老北京布鞋'},
                {value:135, name:'李宁宁'},
                {value:348, name:'匡威'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
}

// 使用刚指定的配置项和数据显示图表。
myChart2.setOption(option2)